<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use Vin7ent\Kj1688\Kj1688;

Route::get('/', function () {
//    return Kj1688::getAddress();
    return Kj1688::productInfoAll('https://detail.1688.com/offer/582588414308.html?spm=a262eq.12364724.jpfoirgc.2.70d810869R0M4o&scm=1007.22298.122578.0&pvid=6f80ab5b-7287-4172-ba67-b4a4d2e1933b&trackInfo=0_582588414308_0.122438_8300.0_7.0_7.0_0.989146116314235_0.0_29.0_9.0_92.2445214462568_0.0_0_940851',
        [
            'addressId' => 651085313,
            'fullName'  => "沈永安",
            'address'   => '侨联东华荣楼 106',
            'post'      => '518000',
            'mobile' => '13872720484',
            'phone' => '13872720484',
            'postCode' => '440307',
            'provinceText' => '广东省',
            'cityText' => '深圳市',
            'areaText' => '龙岗区',
            'isDefault' => false,
            'districtCode' => '440307013',
            'townText' => '坂田街道'
        ]);
//    return Kj1688::getAlipayUrl([299205058072519652,298883200655519652]);
//    return Kj1688::getLogisticsDetail(297289536879519652);
    return Kj1688::previewOrder('general',
        [
            'addressId' => 651085313,
            'fullName'  => "沈永安",
            'address'   => '侨联东华荣楼 106',
            'post'      => '518000',
            'mobile' => '13872720484',
            'phone' => '13872720484',
            'postCode' => '440307',
            'provinceText' => '广东省',
            'cityText' => '深圳市',
            'areaText' => '龙岗区',
            'isDefault' => false,
            'districtCode' => '440307013',
            'townText' => '坂田街道'
        ],
        [
            'offerId' => 564968767196,
            'specId'  => '6cf4ba056468075622f645dc51dab8f3',
            'quantity' => 5
        ],
        [
            'invoiceType'   => '0',
            'fullName'      => '张三',
            'mobile'        => '15251667788',
            'phone'         => '0517-88990077',
            'postCode'      => '邮编',
            'cityText'      => '杭州市',
            'provinceText'  => '浙江省',
            'areaText'      => '滨江区',
            'townText'      => '长河镇',
            'address'       => '网商路699号',
            'companyName'   => '测试公司',
            'taxpayerIdentifier' => '123455',
            'bankAndAccount'=> '网商银行',
            'localInvoiceId'=> '121231'
        ]
    );
    return view('welcome');
});
